home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat4 / efs.z / efs
Encoding:
Text File  |  2002-10-03  |  7.6 KB  |  199 lines

  1.  
  2.  
  3.  
  4. eeeeffffssss((((4444))))                                                                  eeeeffffssss((((4444))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      efs - layout of the Extent File System
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ppppaaaarrrraaaammmm....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ffffssss////eeeeffffssss....hhhh>>>>
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      An Extent File System can reside on a regular disk partition or on a
  17.      logical volume; see _l_v(1M).  The disk partition or volume is divided into
  18.      a certain number of 512-byte sectors, also called _b_a_s_i_c _b_l_o_c_k_s.  The
  19.      current maximum size limit of an Extent File System is 16777214 blocks,
  20.      equivalent to 8 gigabytes.
  21.  
  22.      The Extent File System imposes a common format for certain vital
  23.      information on its underlying storage medium.  Basic block 0 is unused
  24.      and is available to contain a bootstrap program or other information.
  25.      Basic block 1 is the _s_u_p_e_r_b_l_o_c_k.  The format of an Extent File System
  26.      superblock is:
  27.  
  28.           /*
  29.            * Structure of the superblock for the Extent File System
  30.            */
  31.           struct efs {
  32.                /*
  33.                 * This portion is read off the volume
  34.                 */
  35.                long fs_size;       /* size of filesystem, in sectors */
  36.                long fs_firstcg;    /* bb offset to first cg */
  37.                long fs_cgfsize;    /* size of cylinder group in bb's */
  38.                short fs_cgisize;   /* bb's in inodes per cylinder group */
  39.                short fs_sectors;   /* sectors per track */
  40.                short fs_heads;     /* heads per cylinder */
  41.                short fs_ncg;       /* # of groups in filesystem */
  42.                short fs_dirty;     /* fs needs to be fsck'd */
  43.                time_t fs_time;     /* last superblock update */
  44.                long fs_magic;      /* magic number */
  45.                char fs_fname[6];   /* filesystem name */
  46.                char fs_fpack[6];   /* filesystem pack name */
  47.                long fs_bmsize;     /* size of bitmap in bytes */
  48.                long fs_tfree;      /* total free data blocks */
  49.                long fs_tinode;     /* total free inodes */
  50.                long fs_bmblock;    /* bitmap location */
  51.                long fs_replsb;     /* location of replicated superblock. */
  52.                char fs_spare[24];  /* space for expansion */
  53.                long fs_checksum;   /* checksum of volume portion of fs */
  54.                /*
  55.                 * The remainder of this structure, defined fully in
  56.                 * <sys/fs/efs_sb.h> is used by the operating system only.
  57.                 */
  58.           };
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. eeeeffffssss((((4444))))                                                                  eeeeffffssss((((4444))))
  71.  
  72.  
  73.  
  74.      The struct efs that is defined in <_s_y_s/_f_s/_e_f_s__s_b._h> contains more fields.
  75.      The extra fields are used internally by the operating system and are not
  76.      discussed here.  If in doubt, consult the include file for any recent
  77.      changes to both the section discussed here and changes to relevant
  78.      definitions.
  79.  
  80.      _f_s__s_i_z_e holds the size in basic blocks of the filesystem.  This variable
  81.      is filled in when the filesystem is first created with _m_k_f_s(1M).
  82.  
  83.      _f_s__f_i_r_s_t_c_g contains the basic block offset to the first _c_y_l_i_n_d_e_r _g_r_o_u_p.
  84.      There are _f_s__n_c_g cylinder groups contained in the filesystem.  Each
  85.      cylinder group is composed of _f_s__c_g_f_s_i_z_e basic blocks, of which
  86.      _f_s__c_g_i_s_i_z_e basic blocks are used for inodes.
  87.  
  88.      _f_s__s_e_c_t_o_r_s and _f_s__h_e_a_d_s are used to specify the geometry of the
  89.      underlying disk containing the filesystem.  _f_s__h_e_a_d_s is in fact currently
  90.      unused and should not be relied upon.
  91.  
  92.      _f_s__d_i_r_t_y is a flag that indicates if the filesystem needs to be checked
  93.      by the _f_s_c_k(1M) program.
  94.  
  95.      The _f_s__t_i_m_e field contains the time stamp of when the filesystem was last
  96.      modified.
  97.  
  98.      _f_s__n_a_m_e holds the _n_a_m_e of the filesystem (where it is mounted, more or
  99.      less) and _f_s__f_p_a_c_k contains which volume this filesystem is.  The
  100.      _f_s__f_p_a_c_k field is singularly useless, but is provided for utility
  101.      compatibility.
  102.  
  103.      _f_s__m_a_g_i_c is used to tag the superblock of the filesystem as an Extent
  104.      File System.  There are two values that are currently used and a macro
  105.      used to test for either one.
  106.  
  107.           #define   EFS_MAGIC 0x072959
  108.           #define EFS_NEWMAGIC     0x07295A
  109.           #define IS_EFS_MAGIC(x)  ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC))
  110.  
  111.      The NEWMAGIC version was added in IRIX 3.3 when the superblock format
  112.      changed slightly.  Filesystems created with that version of _m_k_f_s or later
  113.      (or modified with _m_k_f_s ----rrrr or extended with _g_r_o_w_f_s) get the new magic
  114.      number; otherwise the older magic number is retained, if present.
  115.  
  116.      The _f_s__b_m_s_i_z_e field contains, in bytes, the size of the data block
  117.      bitmap.  The data block bitmap is used for data block allocation.  Each
  118.      one in the bitmap indicates a free block.
  119.  
  120.      The _f_s__b_m_b_l_o_c_k field contains the location of the bitmap if it has been
  121.      moved from its default location (basic block 2) because the filesystem
  122.      has been constructed on a logical volume that has been extended (see
  123.      _g_r_o_w_f_s(1M)).
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. eeeeffffssss((((4444))))                                                                  eeeeffffssss((((4444))))
  137.  
  138.  
  139.  
  140.      _f_s__t_f_r_e_e and _f_s__t_i_n_o_d_e contain the total free blocks and inodes,
  141.      respectively.
  142.  
  143.      The _f_s__r_e_p_l_s_b field contains the location of a replicated superblock, if
  144.      one exists.
  145.  
  146.      The _f_s__s_p_a_r_e field is reserved for future use.
  147.  
  148.      Lastly, the _f_s__c_h_e_c_k_s_u_m variable holds a checksum of the above fields
  149.      (not including itself).
  150.  
  151.      During the _m_o_u_n_t(1M) of the filesystem, the _f_s__d_i_r_t_y and _f_s__c_h_e_c_k_s_u_m
  152.      fields are examined.  If _f_s__d_i_r_t_y is non-zero, or the _f_s__c_h_e_c_k_s_u_m
  153.      variable does not match the systems computed checksum, the filesystem
  154.      must be cleaned with _f_s_c_k before it can be mounted.  If the filesystem is
  155.      the _r_o_o_t partition, this check is ignored, as it is necessary to be able
  156.      to run _f_s_c_k on a dirty _r_o_o_t from a dirty _r_o_o_t.  For the format of an
  157.      inode and its flags, see _i_n_o_d_e(4).
  158.  
  159. FFFFIIIILLLLEEEESSSS
  160.      /usr/include/sys/fs/efs*.h
  161.      /usr/include/sys/stat.h
  162.  
  163. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  164.      fsck(1M), growfs(1M), mkfs(1M), inode(4).
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.